package com.shihang.crm.bak;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class CmdUtil {
	
	public static String exec(String content){
		String message = "";
		Runtime run = Runtime.getRuntime();
        try {
            Process process = run.exec(content);
            InputStream in = process.getInputStream();
            InputStreamReader reader = new InputStreamReader(in);
            BufferedReader br = new BufferedReader(reader);
            StringBuffer sb = new StringBuffer();
            while((message = br.readLine()) != null) {
                sb.append(message).append("\n");
            }
            //System.out.println(sb);
            message = sb.toString();
        } catch (IOException e) {
            e.printStackTrace();
        }
		return message;
	}

}
